﻿#if NETFX_CORE
using Windows.UI.Xaml.Controls;
#else
using System.Windows.Controls;
#endif

namespace FreshMeat.Xaml
{
   /// <summary>
   /// A cross-platform version of DataGrid which is built-in to WPF and available
   /// in the Silverlight Toolkit.  This version has the simple advantage that it can
   /// be used from XAML which is shared by both WPF and Silverlight because it doesn't
   /// require different xmlns declarations for WPF and Silverlight, which would prevent
   /// sharing the XAML.
   /// </summary>
#if NETFX_CORE
   // TODO: Figure out how to implement XDataGrid for NETFX_CORE
   public class XDataGrid : Control
   {
   }
#elif SILVERLIGHT
   public class XDataGrid : DataGrid
   {
      public XDataGrid()
      {
         AlternatingRowBackground = null; // To match the WPF default value
      }
   }
#else
   public class XDataGrid : DataGrid
   {
      public XDataGrid()
      {
         CanUserResizeRows = false; // To match Silverlight, which doesn't have this 
         CanUserDeleteRows = false; // To match Silverlight, which doesn't have this 
         HeadersVisibility = DataGridHeadersVisibility.Column; // To match the Silverlight default value
      }
   }
#endif

   // DataGridCell is sealed in Silverlight
//#if SILVERLIGHT
//   public class XDataGridCell : DataGridCell {}
//#else
//   public class XDataGridCell : DataGridCell { }
//#endif

#if NETFX_CORE
   public abstract class XDataGridColumn : Control { }
#elif SILVERLIGHT
   public abstract class XDataGridColumn : DataGridColumn {}
#else
   public abstract class XDataGridColumn : DataGridColumn { }
#endif

#if NETFX_CORE
   public abstract class XDataGridBoundColumn : Control { }
#elif SILVERLIGHT
   public abstract class XDataGridBoundColumn : DataGridBoundColumn {}
#else
   public abstract class XDataGridBroundColumn : DataGridBoundColumn { }
#endif

#if NETFX_CORE
   public class XDataGridCheckBoxColumn : Control { }
#elif SILVERLIGHT
   public class XDataGridCheckBoxColumn : DataGridCheckBoxColumn {}
#else
   public class XDataGridCheckBoxColumn : DataGridCheckBoxColumn { }
#endif

   // Doesn't exist in Silverlight
//#if SILVERLIGHT
//   public class XDataGridComboBoxColumn : DataGridComboBoxColumn { }
//#else
//   public class XDataGridComboBoxColumn : DataGridComboBoxColumn { }
//#endif

// Doesn't exist in Silverlight
//#if SILVERLIGHT
//   public class XDataGridHyperLinkColumn : DataGridHyperlinkColumn {}
//#else
//   public class XDataGridHyperLinkColumn : DataGridHyperlinkColumn { }
   //#endif

#if NETFX_CORE
   public class XDataGridTemplateColumn : Control { }
#elif SILVERLIGHT
   public class XDataGridTemplateColumn : DataGridTemplateColumn {}
#else
   public class XDataGridTemplateColumn : DataGridTemplateColumn { }
#endif

#if NETFX_CORE
   public class XDataGridTextColumn : Control { }
#elif SILVERLIGHT
   public class XDataGridTextColumn : DataGridTextColumn {}
#else
   public class XDataGridTextColumn : DataGridTextColumn { }
#endif
}
